<?php

//version AVEC PAGINATOR
include_once 'autoload.php';
$dbAdapter=new Zend_Db_Adapter_Pdo_Mysql(array(
    'host ' => 'localhost',
    'username' => 'root',
    'password' => '',
    'dbname' => 'gsb_frais'
        ));
$lesVisiteurs = new Zend_Db_Select($dbAdapter);
$lesVisiteurs->from('visiteur');
//parametres de vue
$view = new Zend_View();
$view->addScriptPath('.');
$view->setEscape('htmlentities'); //nb tester l'affichage des accents 
$view->setEncoding('ISO-8859-1');

//parametres de paginator
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($lesVisiteurs));
$paginator->setItemCountPerPage(5);
$currentPage = isset ($_GET['page']) ? (int) htmlentities($_GET['page']) : 1;
$paginator->setCurrentPageNumber($currentPage);

//rendu
$view->paginator = $paginator;
echo $view->render('paginatorView02.php');
?>
